<template>
  <div class="pager-container">
    <Pager :total="total" :current="current" @pageChange="handlePageChange" />
  </div>
</template>
<script>
// import Pager from "./";// ./默认找index.vue
import Pager from "./index.vue";
export default {
  data() {
    return {
      current: 1,
      total: 506,
    };
  },
  components: {
    Pager,
  },
  methods: {
    handlePageChange(newPage) {
      if (newPage < 1) {
        newPage = 1;
      }
      if (newPage > this.pageNumber) {
        newPage = this.pageNumber;
      }
      if (newPage == this.current) {
        return;
      }
      this.current = newPage;
    },
  },
};
</script>
<style scoped>
</style>



